﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="pack://application:,,,/Themes/SharedResources.xaml"/>
        <ResourceDictionary Source="pack://application:,,,/Themes/Scrolls/ScrollBar.Buttons.xaml"/>
        <ResourceDictionary Source="pack://application:,,,/Themes/Scrolls/ScrollBar.Thumb.xaml"/>
    </ResourceDictionary.MergedDictionaries>

    <ControlTemplate x:Key="HorizontalScrollBarTemplate" TargetType="{x:Type ScrollBar}">
        <Border Background="{TemplateBinding Background}"
                BorderBrush="{TemplateBinding BorderBrush}"
                BorderThickness="{TemplateBinding BorderThickness}"
                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <RepeatButton Grid.Column="0"
                              Command="{x:Static ScrollBar.LineLeftCommand}"
                              IsEnabled="{TemplateBinding IsEnabled}"
                              Style="{StaticResource ScrollBarLineLeftButtonStyle}"
                              Visibility="Collapsed"/>
                <Track x:Name="PART_Track"
                       Grid.Column="1">
                    <Track.DecreaseRepeatButton>
                        <RepeatButton Command="{x:Static ScrollBar.PageLeftCommand}"
                                      IsEnabled="{TemplateBinding IsEnabled}"
                                      Style="{StaticResource ScrollBarPageButtonStyle}"/>
                    </Track.DecreaseRepeatButton>
                    <Track.Thumb>
                        <Thumb IsEnabled="{TemplateBinding IsEnabled}"
                               Style="{StaticResource ScrollBarThumbStyle}"/>
                    </Track.Thumb>
                    <Track.IncreaseRepeatButton>
                        <RepeatButton Command="{x:Static ScrollBar.PageRightCommand}"
                                      IsEnabled="{TemplateBinding IsEnabled}"
                                      Style="{StaticResource ScrollBarPageButtonStyle}"/>
                    </Track.IncreaseRepeatButton>
                </Track>
                <RepeatButton Grid.Column="2"
                              Command="{x:Static ScrollBar.LineRightCommand}"
                              IsEnabled="{TemplateBinding IsEnabled}"
                              Style="{StaticResource ScrollBarLineRightButtonStyle}"
                              Visibility="Collapsed"/>
            </Grid>
        </Border>
    </ControlTemplate>

</ResourceDictionary>